package com.fpost.scheduling;

import java.util.Timer;

public class FpostTaskScheduler {

	public static void start() {
	    
		Timer timer = new Timer();
		
//	    Calendar date = Calendar.getInstance();
//	    date.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
//	    date.set(Calendar.HOUR, 0);
//	    date.set(Calendar.MINUTE, 0);
//	    date.set(Calendar.SECOND, 0);
//	    date.set(Calendar.MILLISECOND, 0);
	    
	    // Schedule to run every Sunday in midnight	    
	    //timer.schedule(new ArticleDictionaryTask(), date.getTime(), period);
		
		//time in milliseconds between successive task executions
	    long period = 1000 * 60; // 1 minutes
	    timer.scheduleAtFixedRate(new ArticleDictionaryTask(), 1000, period);
	}
}
